#ifndef CONST_H
#define CONST_H

#define SUCCESS                 0
#define FAIL                    1

#define DB_OK                   0
#define DB_NOTFOUND             1403
#define DB_KEYDUPLICATE         -1
#define DB_DBSFUNCERR           543

#define DBS_SELECT     1
#define DBS_LOCK       2
#define DBS_UPDATE     3
#define DBS_INSERT     4
#define DBS_DELETE     5
#define DBS_INIT       6

#define DBS_OPEN       10   /* include DECLARE and OPEN */
#define DBS_FETCH      11
#define DBS_CLOSE      12

#define SQL_CODE_PROCESS(table,action) \
if(sqlca.sqlcode!=DB_OK && sqlca.sqlcode!=DB_NOTFOUND) \
{ \
    printf("%s: %s --- ISAM Code: %d, Info: %s", \
        table, action, \
        sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); \
} \
return(sqlca.sqlcode)

#endif
